package com.vsen.lpr;

import com.google.common.collect.Lists;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;

public class TestUtil {

    public static void main(String[] args) {
        System.out.println(Arrays.toString(TestUtil.getLabels()));
    }


    private static String[] getLabels() {
        String serviceName = "colorService";
        String methodName = "getcolor";
        List<String> list = Arrays.asList("ep-biz-cn", "1.5.6", "1.5.2", "ios", "sda");
        String exceptionSimpleName = "bizExpection";
        StringBuilder labels = new StringBuilder(serviceName + "&" + methodName + "&" + exceptionSimpleName + "&");
        StringBuilder totalLabels = new StringBuilder(serviceName + "#" + methodName + "#" + exceptionSimpleName + "#");
        for (String fieldName : list) {
            labels.append(fieldName).append("&");
            totalLabels.append(fieldName).append("#");
        }

        labels.append(totalLabels);
        return labels.toString().split("&");
    }
}
